<?php
$a=[58,70,'php'=>98, 'python'=>85];
echo max($a), "\t", min($a),"\n";
print_r(range(3,5, 2));
print_r(range(3.2,3.5, .1));
print_r(range("D","B"));
//sort($a); //不保留键值
//rsort($a);
//asort($a); //保留关联关系
//arsort($a);
//ksort($a); //对键进行排序
krsort($a);
print_r($a);
$a=['book-12','book-8','book-3','book-15'];
sort($a);
print_r($a);
sort($a, SORT_NATURAL); //自然顺序
print_r($a);

//显示数组中成绩最高的课程名称及成绩
$a=['PHP'=>98,'Java'=>88,"React"=>95];
arsort($a);
$keys=array_keys($a);
echo "课程名称：", $keys[0], "，成绩为：", $a[$keys[0]],"\n";

//求数组中多门课程的总成绩
$sum=array_sum($a);
echo "各门课程的总成绩为：", $sum, "\n";
